package modelLayer;

public class Product{
    private String name;
    private int barcode;
    private double price;
    private String locationCode;
    private int inStock;
    
    public Product(String name, int barcode, double price, String locationCode, int inStock){
        this.name = name;
        this.barcode = barcode;
        this.price = price;
        this.locationCode = locationCode;
        this.inStock = inStock;
    }
    
    public void setName(String name){
        this.name = name;
    }
    
    public String getName(){
        return name;
    }
    
    public void setBarcode(int barcode){
        this.barcode = barcode;
    }
    
    public int getBarcode(){
        return barcode;
    }
    
    public void setPrice(double price){
        this.price = price;
    }
    
    public double getPrice(){
        return price;
    }
    
    public void setLocationCode(String locationCode){
        this.locationCode = locationCode;
    }
    
    public String getLocationCode(){
        String code = null;
        if(locationCode.equals("1")){
            code = "Timber Department";
            
        }
        else if(locationCode.equals("2")){
            code = "DIY Department";
        }
        else{
            code = "Invalid Location Code";
        }
        
        return code;

    }
    
    public void setInStock(int inStock) {
        this.inStock = inStock;
    }
    
    public int getInStock() {
        return inStock;
    }
    

}